//
//  YLPdfViewController.m
//  YLFinanceService
//
//  Created by she1323 on 2017/10/24.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLPdfViewController.h"
#import <WebKit/WebKit.h>
#import "WHProgressHUD.h"

@interface YLPdfViewController ()<UIWebViewDelegate>

@end

@implementation YLPdfViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"协议";
    
    [WHProgressHUD showStatus:@"正在获取协议内容..."];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    webView.delegate = self;
    webView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:webView];
    
    NSURL *filePath = [NSURL URLWithString:_fileName];
    NSURLRequest *request = [NSURLRequest requestWithURL:filePath];
    [webView loadRequest:request];
    //设置缩放
    [webView setScalesPageToFit:YES];
}

- (void)dealloc
{
    [WHProgressHUD dismiss];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [WHProgressHUD dismiss];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
